import { createWebHashHistory, createRouter } from "vue-router";

const router = createRouter({
  history: createWebHashHistory(),
  routes: [
    {
      path: "/",
      redirect: "/QRcode",
      meta: {
        title: "首页",
      },
    },
    {
      path: "/QRcode/:id?",
      name: "QRcode",
      meta: {
        title: "文件列表",
      },
      props: true,
      component: () => import("~/views/QRcode.vue"),
    },
    {
      path: "/QRcodeAdmin",
      name: "QRcodeAdmin",
      meta: {
        title: "管理",
      },
      component: () => import("~/views/QRcodeAdmin.vue"),
    },
    {
      path: "/About",
      name: "About",
      meta: {
        title: "关于",
      },
      component: () => import("~/views/About.vue"),
    }, {
      path: "/test",
      name: "test",
      meta: {
        title: "测试",
      },
      component: () => import("~/views/test.vue"),
    },
  ],
});

export default router;